package com.custom.common.config;

import com.custom.common.filter.InterfaceFilter;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Description: 过滤器配置注册类
 * @version: 1.0
 * @Author: huxl
 * @Date: 2018-05-24 16:07
 */
@Configuration
public class FilterConfig {

    @Bean
    public FilterRegistrationBean registFilter() {
        FilterRegistrationBean registration = new FilterRegistrationBean();
        registration.setFilter(new InterfaceFilter());
        registration.addUrlPatterns("/*");
        registration.setName("InterfaceFilter");
        registration.setOrder(1);
        return registration;
    }

}